var express = require('express');
var router = express.Router();

/* GET users listing. */
router.get('/', function(req, res, next) {
  res.send('女神！你好吗？');
});

http://192.168.0.104:3000/registHandler

router.get('/form', function(req, res, next) {
  res.render('regist_user',{});
});

router.post('/registHandler', 
	function(req, res, next) {
  res.send(req.param('uName')+":"+req.param('sex')+JSON.stringify(req.body,null,4));

});

// 传参：
// /haha/:name  =》  req.params.name
// ?age=18      =>   req.param('age')
// post age=18  =>    req.body.age
router.get('/haha/:name', function(req, res, next) {
  // res.send('林姐姐老了！'+JSON.stringify(req.params,null,4));
  res.send(req.param('age'));
  res.send("hehe");
});


module.exports = router;
